﻿using AMAP.Areas.Supplier.Models.Home;
using AMAP.ServiceInterfaces;
using System.Web.Mvc;

namespace AMAP.Areas.Supplier.Controllers
{
    public class HomeController : Controller
    {
        private ISupplierService SupplierService;

        public HomeController(ISupplierService SupplierService)
        {
            this.SupplierService = SupplierService;
        }

        [Authorize(Roles = "Supplier")]
        public ActionResult Index()
        {
            SupplierHomeIndexViewModel Model = new SupplierHomeIndexViewModel();
            Model.Supplier = this.SupplierService.GetByEmail(User.Identity.Name);

            return View(Model);
        }

    }
}
